import * as types from "../actionTypes"
const initialState = {
  list: [],
  activeId: null,
}
export default function channel(state = initialState, action) {
  switch (action.type) {
    case types.GETCHANNEL:
      return { ...state, list: action.payload } // payload是频道数据

    case types.TOGGLEACTIVE:
      return { ...state, activeId: action.payload } // payload是激活id
    default:
      return state
  }
}
